package com.zm.zyz.servlet;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.google.gson.Gson;
import com.zm.zyz.entity.ZyzUser;
import com.zm.zyz.vo.Result;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

import static com.zm.zyz.util.Utils.print;

@WebServlet("/myInfo")
public class MyInfoServlet extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        ZyzUser user = (ZyzUser) req.getSession().getAttribute("loginedUser");
        if(user == null){
            print(resp,new Result(0,"未登录",null));
        }else{
            print(resp,new Result(1,"已登录",user));
        }

    }

}
